import DeckBody from './components/Deck.tsx';
import './App.css';

function App() {
  const cards = Array.from({ length: 108 }, (_, index) => ({
    value: index >= 104 && index <= 105 ? 14 : index > 105 ? 15 : Math.floor(index / 8) + 1,
    suit: index >= 104 && index <= 105 ? 'black' : index > 105 ? 'red':
          index % 4 === 0 ? 'spades' :
          index % 4 === 1 ? 'hearts' :
          index % 4 === 2 ? 'diamonds' :
          'clubs'
  }))
  const shuffle = (array) => {
    for (let i = array.length - 1; i > 0; i--) {
      const j = Math.floor(Math.random() * (i + 1));
      [array[i], array[j]] = [array[j], array[i]];
    }
    return array;
  };
  shuffle(cards)
  console.log(cards)
  return (
    <div className="App">
      <DeckBody cards={cards}/>
    </div>
  );
}

export default App;
